import requests
from bs4 import BeautifulSoup


def hot():
    # Hostloc当日回复热帖，每五个小时更新
    # id = 2
    url = 'https://www.hostloc.com/misc.php?mod=ranklist&type=thread&view=replies&orderby=today'
    response = requests.get(url).text
    soup = BeautifulSoup(response, 'lxml')
    posts = soup.select('th > a')
    data = []
    for each in posts:
        data.append([each.text, 'https://www.hostloc.com/' + each.get('href')])
    return str(data)


if __name__ == '__main__':
    hot()